﻿//-----------------------------------------------------------------------
// <copyright file="FormatOptions.cs" company="AFS">
// Copyright (c) AFS. All rights reserved.
//
//    This file is part of Chatbox.
//
//    Chatbox is free software: you can redistribute it and/or modify
//    it under the terms of the GNU Lesser General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    any later version.
//
//    Chatbox is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//    GNU Lesser General Public License for more details.
//
//    You should have received a copy of the GNU Lesser General Public License
//    along with Chatbox. If not, see http://www.gnu.org/copyleft/lesser.html
// </copyright>
//----------------------------------------------------------------------- 

namespace ChatBox.UI.MessageDisplay
{
    using System.Windows;

    using ChatBox.DomainObjects.XmlFeedObjects;
    using ChatBox.XamlUtility;

    /// <summary>
    /// Options and flags when formatting output text
    /// </summary>
    public class FormatOptions
    {
        /// <summary>
        /// Initializes a new instance of the FormatOptions class
        /// </summary>
        /// <param name="fontSize">text size to use</param>
        /// <param name="showDate">flag to show the message date or not</param>
        /// <param name="markPrivateMessages">flag to give private messages special marking or not</param>
        public FormatOptions(
            double fontSize,
            DateTimeDisplay showDate,
            bool markPrivateMessages)
        {
            this.FontSize = fontSize;
            this.ShowDate = showDate;
            this.MarkPrivateMessages = markPrivateMessages;
        }

        /// <summary>
        /// Initializes a new instance of the FormatOptions class copying from another
        /// </summary>
        /// <param name="original">the FormatOptions context to copy</param>
        public FormatOptions(FormatOptions original)
        {
            this.FontSize = original.FontSize;
            this.ShowDate = original.ShowDate;
            this.MarkPrivateMessages = original.MarkPrivateMessages;

            this.ShowSendPrivateMessageButton = original.ShowSendPrivateMessageButton;
            this.SendPrivateMessageButtonStyle = original.SendPrivateMessageButtonStyle;
            this.DeleteMessageButtonStyle = original.DeleteMessageButtonStyle;

            this.SendPrivateMessageButtonHandler = original.SendPrivateMessageButtonHandler;
            this.DeleteMessageButtonHandler = original.DeleteMessageButtonHandler;
        }

        /// <summary>
        /// Gets or sets the font size
        /// </summary>
        public double FontSize { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to show dates in messages
        /// </summary>
        public DateTimeDisplay ShowDate { get; set; }

        /// <summary>
        ///  Gets or sets a value indicating whether to mark out private messages
        /// </summary>
        public bool MarkPrivateMessages { get; set; }

        /// <summary>
        ///  Gets or sets a value indicating whether to show "send private message" buttons
        /// </summary>
        public bool ShowSendPrivateMessageButton { get; set; }

        /// <summary>
        ///  Gets or sets a value indicating whether to show "delete message" buttons
        /// </summary>
        public bool ShowDeleteMessageButton { get; set; }
        
        /// <summary>
        /// Gets or sets the style for the "send private messages" button
        /// </summary>
        public Style SendPrivateMessageButtonStyle { get; set; }

        /// <summary>
        /// Gets or sets the style for the "delete message" button
        /// </summary>
        public Style DeleteMessageButtonStyle { get; set; }

        /// <summary>
        /// Gets or sets the handler for the "send private messages" button
        /// </summary>
        public LinkEvent SendPrivateMessageButtonHandler { get; set; }

        /// <summary>
        /// Gets or sets the handler for the "delete messages" button
        /// </summary>
        public MessageEvent DeleteMessageButtonHandler { get; set; }
    }
}
